package cc.rengu.igas.momp.common.dao.impl;

import cc.rengu.igas.momp.common.dao.McInfoListMapper;
import cc.rengu.igas.momp.common.entity.*;
import cc.rengu.jradp.mods.dbs.Database;
import cc.rengu.oltp.service.common.constant.AppConfigConstant;
import cc.rengu.oltp.service.common.constant.AppParamConstant;
import cc.rengu.oltp.utility.bean.PageInfo;
import cc.rengu.oltp.utility.bean.PageResult;
import cc.rengu.oltp.utility.util.DbsUtil;
import cc.rengu.oltp.utility.util.XmlConfigUtil;
import cc.rengu.oltp.utility.util.XmlTreeUtil;
import cc.rengu.utility.cache.UnifiedCache;
import cc.rengu.utility.log.RgLog;
import cc.rengu.utility.log.RgLogger;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 营销活动列表查询数据库操作接口实现
 *
 * @author Jinan Liu
 * @version 1.0.0
 * @date 2020/3/9 23:51
 */
public class McInfoListMapperImpl implements McInfoListMapper {

    private RgLogger rglog = RgLog.getLogger(this.getClass().getName());
    String dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(AppParamConstant.DATABASE_CONF_NODE, AppConfigConstant.MOMP_POOL_NAME);

    /**
     * @param instId
     * @param mcNo
     * @param mcName
     * @param mcType
     * @param mcStatus
     * @param auditStatus
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMoneyOffInfo>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/3/10 00:13
     * @description 减免类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcMoneyOffInfo> selectMoneyOffMcListInfo(String instId, String mcNo, String mcName, String mcType, String mcStatus, String auditStatus) throws Exception {

        String queryClause = instId + mcNo + mcName + mcType + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfo");

        // 按接口赋查询条件
        TMMcMoneyOffInfo moneyOffInfo = new TMMcMoneyOffInfo();
        moneyOffInfo.setInstId(instId);
        moneyOffInfo.setMcNo(mcNo);
        moneyOffInfo.setMcName(mcName);
        moneyOffInfo.setMcType(mcType);
        moneyOffInfo.setMcStatus(mcStatus);
        moneyOffInfo.setAuditStatus(auditStatus);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, moneyOffInfo, TMMcMoneyOffInfo.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件<{}>获取减免类营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMMcMoneyOffInfo) (item)).collect(Collectors.toList());
    }

    /**
     * @param instId
     * @param mcNo
     * @param mcName
     * @param mcType
     * @param mcStatus
     * @param auditStatus
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcAgentProfitSharingInfo>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/3/16 12:41
     * @description 代理商分润类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcAgentProfitSharingInfo> selectAgentProfitSharingMcListInfo(String instId, String mcNo, String mcName, String mcType, String mcStatus, String auditStatus, String agentMchntNo) throws Exception {

        String queryClause = instId + mcNo + mcName + mcType + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectAgentProfitSharingMcListInfo");

        // 按接口赋查询条件
        TMMcAgentProfitSharingInfo mcAgentProfitSharingInfo = new TMMcAgentProfitSharingInfo();
        mcAgentProfitSharingInfo.setInstId(instId);
        mcAgentProfitSharingInfo.setMcNo(mcNo);
        mcAgentProfitSharingInfo.setMcName(mcName);
        mcAgentProfitSharingInfo.setMcType(mcType);
        mcAgentProfitSharingInfo.setMcStatus(mcStatus);
        mcAgentProfitSharingInfo.setAuditStatus(auditStatus);
        mcAgentProfitSharingInfo.setAgentMchntNo(agentMchntNo);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcAgentProfitSharingInfo, TMMcAgentProfitSharingInfo.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件<{}>获取代理商分润类营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMMcAgentProfitSharingInfo) (item)).collect(Collectors.toList());
    }

    /**
     * @param instId
     * @param mcNo
     * @param mcName
     * @param mcType
     * @param mcStatus
     * @param auditStatus
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcCashierCashbackInfo>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/3/16 12:41
     * @description 收银员返现类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcCashierCashbackInfo> selectCashierCashbackMcListInfo(String instId, String mcNo, String mcName, String mcType, String mcStatus, String auditStatus) throws Exception {
        String queryClause = instId + mcNo + mcName + mcType + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCashierCashbackMcListInfo");

        // 按接口赋查询条件
        TMMcCashierCashbackInfo mcCashierCashbackInfo = new TMMcCashierCashbackInfo();
        mcCashierCashbackInfo.setInstId(instId);
        mcCashierCashbackInfo.setMcNo(mcNo);
        mcCashierCashbackInfo.setMcName(mcName);
        mcCashierCashbackInfo.setMcType(mcType);
        mcCashierCashbackInfo.setMcStatus(mcStatus);
        mcCashierCashbackInfo.setAuditStatus(auditStatus);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcCashierCashbackInfo, TMMcCashierCashbackInfo.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件<{}>获取收银员返现类营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMMcCashierCashbackInfo) (item)).collect(Collectors.toList());
    }

    /**
     * @param instId
     * @param mcNo
     * @param mcName
     * @param mcType
     * @param mcStatus
     * @param auditStatus
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcCouponInfo>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/3/16 12:41
     * @description 卡券类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcCouponInfo> selectCouponMcListInfo(String instId, String mcNo, String mcName, String mcType, String mcStatus, String auditStatus) throws Exception {
        String queryClause = instId + mcNo + mcName + mcType + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfo");

        // 按接口赋查询条件
        TMMcCouponInfo mcCouponInfo = new TMMcCouponInfo();
        mcCouponInfo.setInstId(instId);
        mcCouponInfo.setMcNo(mcNo);
        mcCouponInfo.setMcName(mcName);
        mcCouponInfo.setMcType(mcType);
        mcCouponInfo.setMcStatus(mcStatus);
        mcCouponInfo.setAuditStatus(auditStatus);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcCouponInfo, TMMcCouponInfo.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件<{}>获取卡券类营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMMcCouponInfo) (item)).collect(Collectors.toList());
    }

    /**
     * @param instId
     * @param mcNo
     * @param mcName
     * @param mcType
     * @param mcStatus
     * @param auditStatus
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMchntFeeDiscountInfo>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/3/16 12:41
     * @description 商户手续费优惠类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcMchntFeeDiscountInfo> selectMchntFeeDiscountMcListInfo(String instId, String mcNo, String mcName, String mcType, String mcStatus, String auditStatus) throws Exception {
        String queryClause = instId + mcNo + mcName + mcType + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMchntFeeDiscountMcListInfo");

        // 按接口赋查询条件
        TMMcMchntFeeDiscountInfo mcMchntFeeDiscountInfo = new TMMcMchntFeeDiscountInfo();
        mcMchntFeeDiscountInfo.setInstId(instId);
        mcMchntFeeDiscountInfo.setMcNo(mcNo);
        mcMchntFeeDiscountInfo.setMcName(mcName);
        mcMchntFeeDiscountInfo.setMcType(mcType);
        mcMchntFeeDiscountInfo.setMcStatus(mcStatus);
        mcMchntFeeDiscountInfo.setAuditStatus(auditStatus);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcMchntFeeDiscountInfo, TMMcMchntFeeDiscountInfo.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件<{}>获取商户手续费减免类营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMMcMchntFeeDiscountInfo) (item)).collect(Collectors.toList());
    }

    /**
     * 营销活动列表临时数据查询数据库操作接口实现
     *
     * @param instId      法人机构号
     * @param mcNo        营销活动编号
     * @param mcStatus
     * @param auditStatus
     * @param tableName
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMPlatBizTmp>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/3/30 12:30
     */
    @Override
    public List<TMPlatBizTmp> selectTmpMcListInfo(String instId, String mcNo, String mcStatus, String auditStatus, String tableName) throws Exception {

        String queryClause = instId + mcNo + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMcListInfo");

        // 按接口赋查询条件
        TMPlatBizTmp platBizTmp = new TMPlatBizTmp();
        platBizTmp.setInstId(instId);
        platBizTmp.setMcNo(mcNo);
        platBizTmp.setMcStatus(mcStatus);
        platBizTmp.setAuditStatus(auditStatus);
        platBizTmp.setOprTableEname(tableName);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, platBizTmp, TMPlatBizTmp.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("根据查询条件<{}>获取营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMPlatBizTmp) (item)).collect(Collectors.toList());
    }

    /**
     * 银行操作员查询所有卡券类营销活动信息数据库操作接口实现
     *
     * @param mfdMcListInfoInObj 商户手续费优惠类营销活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectMfdMcListInfoByBankBasicRole(MfdMcListInfoInObj mfdMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMfdMcListInfoByBankBasicRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, mfdMcListInfoInObj, MfdMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行操作员查询所有卡券类营销活动信息数据库操作接口实现
     * 分页模式
     *
     * @param cpMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCouponMcListInfoByBankBasicRole(CpMcListInfoInObj cpMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByBankBasicRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行操作员查询所有卡券类营销活动信息数据库操作接口实现
     * 不分页模式
     *
     * @param cpMcListInfoInObj 卡券类营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.CpMcListInfoOutObj> 卡券类营销活动列表查询使用实体类出参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 20:30
     */
    @Override
    public List<CpMcListInfoOutObj> selectCouponMcListInfoByBankBasicRole(CpMcListInfoInObj cpMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByBankBasicRole");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", cpMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (CpMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 银行操作员查询所有减免类营销活动信息数据库操作接口实现
     * 分页模式
     *
     * @param moMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectMoneyOffMcListInfoByBankBasicRole(MoMcListInfoInObj moMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByBankBasicRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行操作员查询所有减免类营销活动信息数据库操作接口定义
     * 不分页模式
     *
     * @param moMcListInfoInObj 营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMoneyOffInfo> 减免类营销活动信息表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 20:11
     */
    @Override
    public List<MoMcListInfoOutObj> selectMoneyOffMcListInfoByBankBasicRole(MoMcListInfoInObj moMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByBankBasicRole");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", moMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (MoMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 银行发布员查询所有卡券类营销活动信息数据库操作接口实现
     *
     * @param mfdMcListInfoInObj 商户手续费优惠类营销活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectMfdMcListInfoByBankPublishRole(MfdMcListInfoInObj mfdMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMfdMcListInfoByBankPublishRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, mfdMcListInfoInObj, MfdMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行发布员查询所有卡券类营销活动信息数据库操作接口实现
     * 分页模式
     *
     * @param cpMcListInfoInObj 卡券类营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCouponMcListInfoByBankPublishRole(CpMcListInfoInObj cpMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByBankPublishRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行发布员查询所有卡券类营销活动信息数据库操作接口定义
     * 不分页模式
     *
     * @param cpMcListInfoInObj 卡券类营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.CpMcListInfoOutObj> 卡券类营销活动列表查询使用实体类出参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 20:48
     */
    @Override
    public List<CpMcListInfoOutObj> selectCouponMcListInfoByBankPublishRole(CpMcListInfoInObj cpMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByBankPublishRole");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>卡券类营销活动列表信息失败!", cpMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (CpMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 银行发布员查询所有减免类营销活动信息数据库操作接口实现
     * 分页模式
     *
     * @param moMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectMoneyOffMcListInfoByBankPublishRole(MoMcListInfoInObj moMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByBankPublishRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行发布员查询所有减免类营销活动信息数据库操作接口定义
     * 分页模式
     *
     * @param moMcListInfoInObj 营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.MoMcListInfoOutObj> 减免类营销活动列表查询使用实体类出参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 20:44
     */
    @Override
    public List<MoMcListInfoOutObj> selectMoneyOffMcListInfoByBankPublishRole(MoMcListInfoInObj moMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByBankPublishRole");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", moMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (MoMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 商户查询所有卡券类营销活动信息数据库操作接口实现
     * 分页模式
     *
     * @param cpMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 13:18
     */
    @Override
    public PageResult selectCouponMcListInfoByMchnt(CpMcListInfoInObj cpMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByMchnt");

        return dbsUtil.dbsFetchPageListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询所有卡券类营销活动信息数据库操作接口实现
     * 不分页模式
     *
     * @param cpMcListInfoInObj 卡券类营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.CpMcListInfoOutObj>
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 21:24
     */
    @Override
    public List<CpMcListInfoOutObj> selectCouponMcListInfoByMchnt(CpMcListInfoInObj cpMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByMchnt");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", cpMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (CpMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 商户查询所有减免类营销活动信息数据库操作接口实现
     * 分页模式
     *
     * @param moMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 13:18
     */
    @Override
    public PageResult selectMoneyOffMcListInfoByMchnt(MoMcListInfoInObj moMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByMchnt");

        return dbsUtil.dbsFetchPageListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询所有减免类营销活动信息数据库操作接口实现
     * 不分页模式
     *
     * @param moMcListInfoInObj 减免类营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.MoMcListInfoOutObj> 减免类营销活动列表查询使用实体类出参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 21:24
     */
    @Override
    public List<MoMcListInfoOutObj> selectMoneyOffMcListInfoByMchnt(MoMcListInfoInObj moMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByMchnt");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", moMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (MoMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 商户查询所有卡券类营销活动信息数据库操作接口实现(使用商圈编号)
     * 分页模式
     *
     * @param cpMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 13:18
     */
    @Override
    public PageResult selectCouponMcListInfoByMchntWithArea(CpMcListInfoInObj cpMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByMchntWithArea");

        return dbsUtil.dbsFetchPageListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询所有卡券类营销活动信息数据库操作接口实现(使用商圈编号)
     * 不分页模式
     *
     * @param cpMcListInfoInObj 卡券类营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.CpMcListInfoOutObj> 卡券类营销活动列表查询使用实体类出参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date `2020/6/16` 21:24
     */
    @Override
    public List<CpMcListInfoOutObj> selectCouponMcListInfoByMchntWithArea(CpMcListInfoInObj cpMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoByMchntWithArea");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, cpMcListInfoInObj, CpMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", cpMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (CpMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 商户查询所有减免类营销活动信息数据库操作接口实现(使用商圈编号)
     * 分页模式
     *
     * @param moMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo          数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 13:18
     */
    @Override
    public PageResult selectMoneyOffMcListInfoByMchntWithArea(MoMcListInfoInObj moMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByMchntWithArea");

        return dbsUtil.dbsFetchPageListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询所有减免类营销活动信息数据库操作接口实现
     * 不分页模式
     *
     * @param moMcListInfoInObj 减免类营销活动列表查询使用实体类入参
     * @return java.util.List<cc.rengu.igas.momp.common.entity.MoMcListInfoOutObj> 减免类营销活动列表查询使用实体类出参
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/6/16 21:23
     */
    @Override
    public List<MoMcListInfoOutObj> selectMoneyOffMcListInfoByMchntWithArea(MoMcListInfoInObj moMcListInfoInObj) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMoneyOffMcListInfoByMchntWithArea");

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, moMcListInfoInObj, MoMcListInfoOutObj.class);
        if (null == objectList || objectList.isEmpty()) {
            rglog.error("获取法人机构<{}>减免类营销活动列表信息失败!", moMcListInfoInObj.getInstId());
            return null;
        }

        return objectList.stream().map(item -> (MoMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * 银行操作员查询收银员返现类活动信息数据库操作接口实现
     *
     * @param ccbMcListInfoInObj 收银员返现活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCcbMcListInfoByBankBasicRole(CcbMcListInfoInObj ccbMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCcbMcListInfoByBankBasicRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, ccbMcListInfoInObj, CcbMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行发布员查询收银员返现类活动信息数据库操作接口实现
     *
     * @param ccbMcListInfoInObj 收银员返现活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCcbMcListInfoByBankPublishRole(CcbMcListInfoInObj ccbMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCcbMcListInfoByBankPublishRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, ccbMcListInfoInObj, CcbMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询收银员返现类活动信息数据库操作接口实现
     *
     * @param ccbMcListInfoInObj 收银员返现活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCcbMcListInfoByMchnt(CcbMcListInfoInObj ccbMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCcbMcListInfoByMchnt");

        return dbsUtil.dbsFetchPageListData(sqlStr, ccbMcListInfoInObj, CcbMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询收银员返现类活动信息数据库操作接口实现(使用商圈编号)
     *
     * @param ccbMcListInfoInObj 收银员返现活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCcbMcListInfoByMchntWithArea(CcbMcListInfoInObj ccbMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCcbMcListInfoByMchntWithArea");

        return dbsUtil.dbsFetchPageListData(sqlStr, ccbMcListInfoInObj, CcbMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询收银员返现明细列表信息数据库操作接口实现(使用商户编号)
     *
     * @param ccbMcDetailListInObj 收银员返现活动明细列表查询使用实体类入参
     * @param pageInfo             数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCashierCashbackDetailByMchNo(CcbMcDetailListInObj ccbMcDetailListInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCashierCashbackDetailByMchNo");

        return dbsUtil.dbsFetchPageListData(sqlStr, ccbMcDetailListInObj, CcbMcDetailListOutObj.class, pageInfo);
    }

    /**
     * 收银员查询收银员返现明细列表信息数据库操作接口实现(使用用户编号)
     *
     * @param ccbMcDetailListInObj 收银员返现活动明细列表查询使用实体类入参
     * @param pageInfo             数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author Jinan Liu
     * @date 2020/5/28 00:04
     */
    @Override
    public PageResult selectCashierCashbackDetailByUserId(CcbMcDetailListInObj ccbMcDetailListInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCashierCashbackDetailByUserId");

        return dbsUtil.dbsFetchPageListData(sqlStr, ccbMcDetailListInObj, CcbMcDetailListOutObj.class, pageInfo);
    }

    /**
     * 商户手续费优惠营销活动信息查询数据库操作接口实现
     *
     * @param instId   法人机构号
     * @param mcNo     营销活动编号
     * @param mcStatus 营销活动状态
     * @throws Exception 异常信息
     * @author liujinan
     * @date 2020/4/28
     */
    @Override
    public TMMcMchntFeeDiscountInfo selectMchntFeeDiscountByMcNoAndstatus(String instId, String mcNo, String mcStatus) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMchntFeeDiscountMcListInfo");

        // 按接口赋查询条件
        TMMcMchntFeeDiscountInfo tmMcMchntFeeDiscountInfo = new TMMcMchntFeeDiscountInfo();
        tmMcMchntFeeDiscountInfo.setInstId(instId);
        tmMcMchntFeeDiscountInfo.setMcNo(mcNo);
        tmMcMchntFeeDiscountInfo.setMcStatus(mcStatus);

        int iReturnCode = dbsUtil.dbsExecuteSql(sqlStr, tmMcMchntFeeDiscountInfo, tmMcMchntFeeDiscountInfo);
        if (0 != iReturnCode) {
            rglog.error("根据查询条件法人机构号<{}>营销活动编号<{}>营销活动状态<{}>获取手续费优惠营销活动信息失败!<{}>", instId, mcNo, mcStatus, iReturnCode);
            return null;
        }

        return tmMcMchntFeeDiscountInfo;
    }

    /**
     * 根据主键查询收银员返现营销活动数据库操作接口定义
     *
     * @param instId
     * @param mcNo
     * @throws Exception 异常信息
     * @author liujinan
     * @date 2020/5/30
     */
    @Override
    public TMMcCashierCashbackInfo selectCashierCashbackByInstIdMcNo(String instId, String mcNo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCashierCashbackByInstIdMcNo");

        TMMcCashierCashbackInfo tmMcCashierCashbackInfo = new TMMcCashierCashbackInfo();
        tmMcCashierCashbackInfo.setInstId(instId);
        tmMcCashierCashbackInfo.setMcNo(mcNo);
        int iReturnCode = dbsUtil.dbsExecuteSql(sqlStr, tmMcCashierCashbackInfo, tmMcCashierCashbackInfo);
        if (Database.DBS_SUCCESS != iReturnCode) {
            rglog.error("根据查询条件获取收银员返现活动信息表失败!<{}>", iReturnCode);
            return null;
        }
        return tmMcCashierCashbackInfo;
    }

    /**
     * 银行操作员查询所有代理商分润营销活动信息数据库操作接口实现
     *
     * @param apsMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author liujinan
     * @date 2020/6/18 00:04
     */
    @Override
    public PageResult selectApsMcListInfoByBankBasicRole(ApsMcListInfoInObj apsMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectApsMcListInfoByBankBasicRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, apsMcListInfoInObj, ApsMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 银行发布员查询所有代理商分润营销活动信息数据库操作接口实现
     *
     * @param apsMcListInfoInObj 代理商分润营销活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author liujinan
     * @date 2020/6/18 00:04
     */
    @Override
    public PageResult selectApsMcListInfoByBankPublishRole(ApsMcListInfoInObj apsMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectApsMcListInfoByBankPublishRole");

        return dbsUtil.dbsFetchPageListData(sqlStr, apsMcListInfoInObj, ApsMcListInfoOutObj.class, pageInfo);
    }

    /**
     * 商户查询所有代理商分润营销活动信息数据库操作接口实现
     *
     * @param apsMcListInfoInObj 营销活动列表查询使用实体类入参
     * @param pageInfo           数据库操作分页实体类
     * @return cc.rengu.oltp.utility.bean.PageResult 查询结果列表
     * @throws Exception 异常信息
     * @author liujinan
     * @date 2020/6/18 13:18
     */
    @Override
    public PageResult selectApsMcListInfoByAgent(ApsMcListInfoInObj apsMcListInfoInObj, PageInfo pageInfo) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectApsMcListInfoByAgent");

        return dbsUtil.dbsFetchPageListData(sqlStr, apsMcListInfoInObj, ApsMcListInfoOutObj.class, pageInfo);
    }

    /**
     * @param instId
     * @param orgId
     * @param cashbackMethod
     * @param mcType
     * @param mcStatus
     * @param txnDate
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcCashierCashbackInfo>
     * @throws Exception 异常信息
     * @author JL Pang
     * @date 2020/9/1 12:41
     * @description 收银员返现类营销活动列表查询数据库操作接口实现（针对查询商圈/商户号，商圈/商户名称）
     */
    @Override
    public List<CcbMcListInfoOutObj> selectCashierCashbackMcListInfoForBaseRole(String instId, String orgId, String mcType, String mcStatus, String txnDate, String cashbackMethod) throws Exception {

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCcbMcListInfoByBankBasicRole");

        // 按接口赋查询条件
        CcbMcListInfoInObj mcCashierCashbackInfo = new CcbMcListInfoInObj();
        mcCashierCashbackInfo.setInstId(instId);
        mcCashierCashbackInfo.setMcType(mcType);
        mcCashierCashbackInfo.setMcStatus(mcStatus);
        mcCashierCashbackInfo.setTxnDate(txnDate);
        mcCashierCashbackInfo.setCashbackMethod(cashbackMethod);
        mcCashierCashbackInfo.setOrgId(orgId);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcCashierCashbackInfo, CcbMcListInfoOutObj.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件获取收银员返现类营销活动列表信息失败!");
            return null;
        }

        return objectList.stream().map(item -> (CcbMcListInfoOutObj) (item)).collect(Collectors.toList());
    }

    /**
     * @param instId
     * @param TxnDate
     * @param mcStatus
     * @param auditStatus
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcMchntFeeDiscountInfo>
     * @throws Exception 异常信息
     * @author JL Pang
     * @date 2020/9/2 12:41
     * @description 商户手续费优惠类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcMchntFeeDiscountInfo> selectMchntFeeDiscountMcListInfoForTime(String instId, String TxnDate, String mcStatus, String auditStatus) throws Exception {
        String queryClause = instId + TxnDate + mcStatus + auditStatus;

        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectMchntFeeDiscountMcListInfoForTime");

        // 按接口赋查询条件
        TMMcMchntFeeDiscountInfo mcMchntFeeDiscountInfo = new TMMcMchntFeeDiscountInfo();
        mcMchntFeeDiscountInfo.setInstId(instId);
        mcMchntFeeDiscountInfo.setRemark1(TxnDate);
        mcMchntFeeDiscountInfo.setMcStatus(mcStatus);
        mcMchntFeeDiscountInfo.setAuditStatus(auditStatus);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcMchntFeeDiscountInfo, TMMcMchntFeeDiscountInfo.class);
        // if (null == objectList || objectList.isEmpty()) {
        if (null == objectList) {
            rglog.error("根据查询条件<{}>获取商户手续费减免类营销活动列表信息失败!", queryClause);
            return null;
        }

        return objectList.stream().map(item -> (TMMcMchntFeeDiscountInfo) (item)).collect(Collectors.toList());
    }


    @Override
    public TMMcMchntFeeDiscountInfo selectTmMcMchntFeeDiscountInfo(String globalInstId, String globalMcNo) throws Exception {
        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectTmMcMchntFeeDiscountInfo");
        // 按接口赋查询条件
        TMMcMchntFeeDiscountInfo tmMcMchntFeeDiscountInfo = new TMMcMchntFeeDiscountInfo();
        tmMcMchntFeeDiscountInfo.setInstId(globalInstId);
        tmMcMchntFeeDiscountInfo.setMcNo(globalMcNo);

        int iReturnCode = dbsUtil.dbsExecuteSql(sqlStr, tmMcMchntFeeDiscountInfo, tmMcMchntFeeDiscountInfo);
        if (0 != iReturnCode) {
            rglog.error("根据查询条件法人机构号<{}>营销活动编号<{}>获取手续费优惠营销活动信息失败!<{}>", globalInstId, globalMcNo, iReturnCode);
            return null;
        }

        return tmMcMchntFeeDiscountInfo;
    }

    @Override
    public int updateTMMcMchntFeeDiscountInfo(TMMcMchntFeeDiscountInfo tmMcMchntFeeDiscountInfo) throws Exception {
        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "updateTMMcMchntFeeDiscountInfo");

        int iReturnCode = dbsUtil.dbsExecuteTransactionSql(sqlStr, tmMcMchntFeeDiscountInfo, null);
        if (0 != iReturnCode) {
            rglog.error("更新营销活动商户信息表T_M_MC_MFD_INFO失败！");
        }
        return iReturnCode;
    }

    @Override
    public int updateTMMcMchntFeeDiscountInfoByMcNo(TMMcMchntFeeDiscountInfo tmMcMchntFeeDiscountInfo) throws Exception {
        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "updateTMMcMchntFeeDiscountInfoByMcNo");

        int iReturnCode = dbsUtil.dbsExecuteTransactionSql(sqlStr, tmMcMchntFeeDiscountInfo, null);
        if (0 != iReturnCode) {
            rglog.error("更新营销活动商户信息表T_M_MC_MFD_INFO失败！");
        }
        return iReturnCode;
    }

    /**
     * @return java.util.List<cc.rengu.igas.momp.common.entity.TMMcCouponInfo>
     * @throws Exception 异常信息
     * @author liujinan
     * @date 2021/1/19 12:41
     * @description 卡券类营销活动列表查询数据库操作接口实现
     */
    @Override
    public List<TMMcCouponInfo> selectCouponMcListInfoWithChannelId(String instId, String mcNo, String mcName, String mcType, String channelId,
                                                                    String mcStatus, String auditStatus, String orgId) throws Exception {
        XmlTreeUtil xmlTreeUtil = new XmlTreeUtil();
        String corporation = xmlTreeUtil.getXmlTreeStringValue(AppParamConstant.CORPORATION);
        if (null != corporation && !corporation.isEmpty()) {
            String dbPoolCashNode = corporation.trim() + AppParamConstant.DATABASE_CONF_NODE;
            dbPoolName = XmlConfigUtil.getXmlConfigCacheKeyValue(dbPoolCashNode, AppConfigConstant.MOMP_POOL_NAME);
        }
        rglog.error("DBPoolName=[{}]", dbPoolName);

        DbsUtil dbsUtil = new DbsUtil(dbPoolName);
        String sqlStr = (String) UnifiedCache.get(AppParamConstant.SQL_MAPPER_CACHE, "selectCouponMcListInfoWithChannelId");

        // 按接口赋查询条件
        TMMcCouponInfo mcCouponInfo = new TMMcCouponInfo();
        mcCouponInfo.setInstId(instId);
        mcCouponInfo.setMcNo(mcNo);
        mcCouponInfo.setMcName(mcName);
        mcCouponInfo.setMcType(mcType);
        mcCouponInfo.setClaimChannelId(channelId);
        mcCouponInfo.setMcStatus(mcStatus);
        mcCouponInfo.setAuditStatus(auditStatus);
        mcCouponInfo.setRemark1(orgId);

        List<Object> objectList = dbsUtil.dbsFetchLimitListData(sqlStr, mcCouponInfo, TMMcCouponInfo.class);
        if (null == objectList) {
            rglog.error("根据查询条件获取卡券类营销活动列表信息失败!");
            return null;
        }

        return objectList.stream().map(item -> (TMMcCouponInfo) (item)).collect(Collectors.toList());
    }
}
